home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 2
/
Gold Medal Software Volume 2 (Gold Medal) (1994).iso
/
prog
/
tpex.arj
/
C9REVEX5.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-09-05
|
3KB
|
81 lines
{
Programming in Turbo Pascal 6.0.
Turbo Pascal By example By Greg Perry.
Chapter 9 Review Exercise #5.
Robert E. Wade 9-5-93
}
PROGRAM PayCheck;
USES Crt, Printer;
CONST Spc = ' ';
Paydate = '9-5-1993';
VAR EmpName: STRING[30];
HoursWorked: REAL;
Rate: REAL;
TaxRate: REAL;
Taxes: REAL;
NetPay: REAL;
BEGIN
CLRSCR;
{ Get data from user }
WRITE( 'What is your Full Name? ');
READLN( EmpName );
WRITE( 'How many hours did you work? ');
READLN( HoursWorked );
WRITE( 'What is your hourly pay rate? ');
READLN( Rate );
WRITE( 'What is your tax rate (Use this format: 0.00)? ');
READLN( TaxRate );
{ Compute Taxes and Net Pay }
Taxes := ( HoursWorked * Rate * TaxRate );
NetPay := ( HoursWorked * Rate - Taxes );
{ Print the check to screen (* I only sent it to
screen also because I do not have a printer *) }
WRITELN;
WRITELN( 'Press ENTER to see the check printed...');
READLN;
WRITELN( '*****************************************************************' );
WRITELN( '*', Spc:63, '*' );
WRITELN( '*', Spc:40, 'Date: ', Paydate, Spc:9, '*' );
WRITELN( '*', Spc:63, '*' );
WRITELN( '* Pay to the Order of: ', EmpName, Spc:27, '*' );
WRITELN( '*', Spc:63, '*' );
WRITELN( '* Pay the full amount of: $', NetPay:10:2, Spc:27, '*' );
WRITELN( '*', Spc:26, '----------', Spc:27, '*' );
WRITELN( '*', Spc:63, '*' );
WRITELN( '*', Spc:39, '----------------------- *' );
WRITELN( '*', Spc:39, 'Dan Chambers, Treasurer *' );
WRITELN( '*', Spc:63, '*' );
WRITELN( '*****************************************************************' );
{ Send output to printer. Uncomment the following code
to send output to the printer. }
{
WRITELN(LST, '*****************************************************************' );
WRITELN(LST, '*', Spc:63, '*' );
WRITELN(LST, '*', Spc:40, 'Date: ', Paydate, Spc:9, '*' );
WRITELN(LST, '*', Spc:63, '*' );
WRITELN(LST, '* Pay to the Order of: ', EmpName, Spc:27, '*' );
WRITELN(LST, '*', Spc:63, '*' );
WRITELN(LST, '* Pay the full amount of: $', GrossPay:10:2, Spc:27, '*' );
WRITELN(LST, '*', Spc:26, '----------', Spc:27, '*' );
WRITELN(LST, '*', Spc:63, '*' );
WRITELN(LST, '*', Spc:39, '----------------------- *' );
WRITELN(LST, '*', Spc:39, 'Dan Chambers, Treasurer *' );
WRITELN(LST, '*', Spc:63, '*' );
WRITELN(LST, '*****************************************************************' );
}
WRITELN( 'Press ENTER to continue...' );
READLN;
END.